package com.xysl.mapper;

import com.xysl.domain.vo.GartenHomeDailyVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface KindergartenMapper {

    @Select("select a.id stuId, a.stu_name, TIMESTAMPDIFF(YEAR, a.birthday, CURDATE()) stuAge\n" +
            "from zl_student a\n" +
            "where a.is_delete = 0\n" +
            "  and a.adviser_user_id = #{userId}\n" +
            "  and SUBSTRING(a.birthday, 6, 5) = #{todayTime}")
    List<GartenHomeDailyVo.BirthdayStu> queryBirthdayStuList(@Param("userId")Long userId,@Param("todayTime")String todayTime);

    @Select("select count(1) \n" +
            "from zl_follow_log_record a where a.follow_user_id = #{userId} and a.plan_follow_time >= #{queryBeginTime} and a.status='0'")
    int queryItemDailyNum(@Param("userId") Long userId, @Param("queryBeginTime")String queryBeginTime);
}
